package sample.three;

import java.util.concurrent.DelayQueue;

import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;


import org.apache.velocity.Template
;public class CCCCCC extends Thread{
	private AAAA aaaa;
	private DelayQueue<RunTask> taskObjects;
	private ThreadPoolTaskExecutor taskExecutor;
	public CCCCCC(){
		this.taskObjects = new  DelayQueue<RunTask>();
		System.out.print("CCC");
	}
	
	public void run() {
		
		while (!Thread.interrupted()) {
			try {
				RunTask task = taskObjects.take();
				taskExecutor.execute(task);	
			} catch (InterruptedException e) {
				
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
	
	
	/**
	 * @param aaaa the aaaa to set
	 */
	public void setAaaa(AAAA aaaa) {
		this.aaaa = aaaa;
	}
	
	
	
	public void setTaskExecutor(ThreadPoolTaskExecutor taskExecutor) {
		this.taskExecutor = taskExecutor;
	}
	
	public void addTask(RunTask runTask) {
		taskObjects.put(runTask);
	}
	
	
}
